home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / csounds / siren.c < prev    next >
Text File  |  1988-08-17  |  360b  |  25 lines

  1. #define FALSE 0
  2. #define TRUE 1
  3.  
  4. void siren()
  5. {
  6.  
  7.   int  freq;
  8.   int  done = FALSE;
  9.  
  10.   do {
  11.     for (freq = 200; freq <= 1000; freq++) {
  12.       sound(freq);
  13.       delay(2);
  14.     }
  15.     for (freq = 1000; freq >= 200; freq--) {
  16.       sound(freq);
  17.       delay(2);
  18.     }
  19.     if (kbhit())
  20.       done = TRUE;
  21.   } while (!(done));
  22.   nosound();
  23. }
  24.  
  25.